package com.hulytu.android.adapter.plugin;


import com.hulytu.android.adapter.ViewAdapter;

import org.jetbrains.annotations.NotNull;

import java.util.Collection;
import java.util.List;

/**
 * 具有保存数据能力的 adapter 扩展
 * <p>
 * 2022.01.22
 * 1. 移除 adapter 的泛型，没有使用的必要，如需要具体到 adapter ，可自行实现
 *
 * @param <T>
 */
public interface AdapterDataSetPlugin<T> {

    boolean contains(T o);

    boolean isEmpty();

    int size();

    void setAll(Collection<? extends T> c);

    boolean add(T t);

    boolean add(T t, boolean notify);

    boolean remove(T o);

    boolean remove(T o, boolean notify);

    boolean addAll(Collection<? extends T> c);

    boolean addAll(Collection<? extends T> c, boolean notify);

    boolean addAll(int index, Collection<? extends T> c);

    boolean addAll(int index, Collection<? extends T> c, boolean notify);

    boolean removeAll(Collection<? extends T> c);

    boolean removeAll(Collection<? extends T> c, boolean notify);

    void clear();

    void clear(boolean notify);

    T get(int index);

    T set(int index, T element);

    T set(int index, T element, boolean notify);

    void add(int index, T element);

    void add(int index, T element, boolean notify);

    T remove(int index);

    T remove(int index, boolean notify);

    int indexOf(T o);

    List<T> dataSet();

    void setAdapter(@NotNull ViewAdapter<?> adapter);

    @NotNull
    ViewAdapter<?> getAdapter();
}
